<?php
include_once 'dbinfo.php';
$id = $_POST['id'];

$link = mysqli_connect($dbhost,$dbusername,$dbpassword,$dbname,$dbport);
if(!$link){
    echo "db connect fail";
    die;
}

$sql = "delete from tb_articles where id=$id";
// echo $sql;

// $result = mysqli_query($link,$sql);
$result = mysqli_multi_query($link,$sql);

if($result){
    echo 'ok';
    // header("Location: http://localhost/articles-demo1-php/php/article_list.php");
}else{
    echo 'fail';
    // header("Location: http://localhost/articles-demo1-php/php/article_list.php");
}
mysqli_close($link);

?>